package com.regent.central.bill.repository;

import com.regent.central.bill.core.DeliveryAction;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.Date;
import java.util.List;

public interface DeliveryActionMapper extends Mapper<DeliveryAction> {

    /**
     * 查找发货单与销售单相关的actionId
     *
     * @param deliveryOrderId
     * @param saleOrderId
     * @return
     */
    List<String> selectGoodsActionIds(@Param("deliveryOrderId") String deliveryOrderId, @Param("saleOrderId") String saleOrderId);

    /**
     * 撤销发货单的指定发货货品的关联动作
     *
     * @param deliveryId       发货单
     * @param userCanceled     撤销人
     * @param dateCanceled     撤销日期
     * @param deliveryGoodsIds 发货货品ID
     */
    void cancel(
            @Param("deliveryId") String deliveryId,
            @Param("userCanceled") String userCanceled,
            @Param("dateCanceled") Date dateCanceled,
            @Param("deliveryGoodsIds") String... deliveryGoodsIds
    );

}